var $statusSor, Deep, markCSS, serialNum, unmarkCSS;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$statusSor = $('<select name="do_req_status">\n<option selected="" value="open">open\n</option><option value="stall">stalled\n</option><option value="resolve">resolved\n</option><option value="kill">dead\n</option></select>').click(function() {
  return false;
});
markCSS = {
  'border-color': 'transparent',
  'border-style': 'solid'
};
unmarkCSS = {
  'border-color': 'none',
  'border-style': 'none'
};
Deep = true;
serialNum = /serial_num=(\d+)/;
jQuery(function($) {
  return $.get('/rt/webrt.cgi', function(data, textStatus, jqXHR) {
    var colPosn, statusCol;
    $('html').html(data);
    $('html').on('click', 'a', function() {
      var href;
      href = $(this).prop('href');
      $.get(href, function(data) {
        return $('html').html(data);
      });
      return false;
    });
    $('font >table >tbody >tr').each(function() {
      var $this, href, sn, _ref;
      $this = $(this);
      href = $('a', $this).attr('href');
      if (sn = (_ref = href.match(serialNum)) != null ? _ref[1] : void 0) {
        return $this.addClass('ticket').attr({
          'id': sn
        });
      }
    });
    colPosn = {
      'status': 3
    };
    statusCol = "tr >td:nth-child(" + colPosn.status + ")";
    $('font >table >tbody').on('mousedown', statusCol, function() {
      var $statusVal;
      $statusVal = $(this).clone(Deep);
      $(this).empty().append($statusSor.clone().one('mouseout', __bind(function() {
        $(this).replaceWith($statusVal);
        return false;
      }, this)));
      return false;
    });
  });
});